﻿@{
    ViewBag.Title = "Home";
    ViewBag.HomeActive = "active";
}

@model Sweepids.Models.Object.User

@if (TempData["Error"] != null)
{
    <div class="alert alert-error">
        @TempData["Error"]
    </div>
}

@if (TempData["Success"] != null)
{
    <div class="alert alert-success">
        @TempData["Success"]
    </div>
}

<div id="sweep_content" class="span9">
    <div id="pending_sweeps" class="well">
        <h5>Pending Items</h5>
        <table id="pending_table" class="table">
            <caption></caption>
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Price</th>
                    <th>Description</th>
                    <th>End Time</th>
                    <th>Sweeps on Item</th>
                </tr>
            </thead>
            <tbody>
                @if (Model.BidOnItemList.Count == 0)
                {
                    <tr>
                        <td colspan="5"><em>You have no pending items</em></td>
                    </tr>
                }
                @foreach (var pendingItem in Model.BidOnItemList)
                {
                    <tr>
                        <td><a href="~/ItemDetail/Detail?itemId=@pendingItem.Id">@pendingItem.Name</a></td>
                        <td>@String.Format("{0:C}", pendingItem.Price)</td>
                        <td>@pendingItem.Description</td>
                        <td>@pendingItem.EndTime</td>
                        <td>@pendingItem.SweepsOnItem</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <div id="items_won" class="well">
        <h5>Items Won</h5>
        <table class="table">
            <caption></caption>
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Price</th>
                    <th>Description</th>
                    <th>End Time</th>
                    <th>Sweeps on Item</th>
                </tr>
            </thead>
            <tbody>
                @if (Model.WonItemsList.Count == 0)
                {
                    <tr>
                        <td colspan="5"><em>You haven't won any items yet.</em></td>
                    </tr>
                }
                @foreach (var winItem in Model.WonItemsList)
                {
                    <tr>
                        <td><a href="ItemDetail/Detail?itemId=@winItem.Id">@winItem.Name</a></td>
                        <td>@String.Format("{0:C}", winItem.Price)</td>
                        <td>@winItem.Description</td>
                        <td>@winItem.EndTime</td>
                        <td>@winItem.SweepsOnItem</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    <div id="items_lost" class="well">
        <h5>Items Lost</h5>
        <table class="table">
            <caption></caption>
            <thead>
                <tr>
                    <th>Name</th>
                    <th>Price</th>
                    <th>Description</th>
                    <th>End Time</th>
                    <th>Sweeps on Item</th>
                    <th>Winning User</th>
                </tr>
            </thead>
            <tbody>
                @if (Model.LoseItemList.Count == 0)
                {
                    <tr>
                        <td colspan="6"><em>You haven't lost any items yet.</em></td>
                    </tr>
                }
                @foreach (var loseItem in Model.LoseItemList)
                {
                    <tr>
                        <td><a href="ItemDetail/Detail?itemId=@loseItem.Id">@loseItem.Name</a></td>
                        <td>@String.Format("{0:C}", loseItem.Price)</td>
                        <td>@loseItem.Description</td>
                        <td>@loseItem.EndTime</td>
                        <td>@loseItem.SweepsOnItem</td>
                        <td>@loseItem.WinUser</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
</div>
<div id="buy_sweeps" class="span3 well">
    <h5>Buy Sweeps</h5>
    <table class="table">
        <caption></caption>
        <thead>
            <tr>
                <th>Amount</th>
                <th>Buy</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td><span class="lead">5</span> sweeps</td>
                <td><a href="~/Home/BuySweeps?value=5" class="btn btn-primary">$3.99</a></td>
            </tr>
            <tr>
                <td><span class="lead">25</span> sweeps</td>
                <td><a href="~/Home/BuySweeps?value=25" class="btn btn-primary">$19.99</a></td>
            </tr>
            <tr>
                <td><span class="lead">50</span> sweeps</td>
                <td><a href="~/Home/BuySweeps?value=50" class="btn btn-primary">$39.99</a></td>
            </tr>
            <tbody>
    </table>
</div>
